package com.bytedance.common.plugin.interfaces.pushmanager.setting;

import android.content.Context;

import com.bytedance.common.plugin.interfaces.pushmanager.setting.PushMultiProcessSharedProvider.MultiProcessShared;

public class LocalHttpSetting {
    public static final String DEEP_LINK_HOST = "deep_link_host";
    private static final String DEFAULT_WHITE_HOST = "m.ixigua.com,va6.365yg.com,va3.365yg.com,m.365yg.com,m.toutiao.com,adshare.toutiao.com,m.pstatp.com,m.toutiao.org,m.zjurl.cn,10.6.131.79";
    public static final String HTTP_MONITOR_PORT = "http_monitor_port";
    private Context mContext;
    private MultiProcessShared multiProcessShared;
    private static LocalHttpSetting sPushSetting;

    private LocalHttpSetting(Context arg2) {

        this.mContext = arg2.getApplicationContext();
        this.multiProcessShared = PushMultiProcessSharedProvider.getMultiprocessShared(this.mContext);
    }

    public String getDeepLinkHost() {
        return this.multiProcessShared.getString("deep_link_host", "m.ixigua.com,va6.365yg.com,va3.365yg.com,m.365yg.com,m.toutiao.com,adshare.toutiao.com,m.pstatp.com,m.toutiao.org,m.zjurl.cn,10.6.131.79");
    }

    public int getHttpMonitorPort() {
        return this.multiProcessShared.getInt("http_monitor_port", 0);
    }

    public static LocalHttpSetting getInstance(Context arg2) {
        LocalHttpSetting v0_1;
        Class v1 = LocalHttpSetting.class;
        synchronized (v1) {
            if (LocalHttpSetting.sPushSetting == null) {
                LocalHttpSetting.sPushSetting = new LocalHttpSetting(arg2);
            }

            v0_1 = LocalHttpSetting.sPushSetting;
        }
        return v0_1;
    }

    public boolean isHttpMonitorEnable() {
        boolean v0 = this.getHttpMonitorPort() > 1024 ? true : false;
        return v0;
    }

    public void setDeepLinkHost(String arg3) {
        this.multiProcessShared.edit().putString("deep_link_host", arg3).apply();
    }

    public void setHttpMonitorPort(int arg3) {
        this.multiProcessShared.edit().putInt("http_monitor_port", arg3).apply();
    }
}

